package com.hhkj.admin.sale.service.base.impl;

import com.hhkj.admin.sale.domain.SaleWithdrawal;
import com.hhkj.admin.sale.mapper.SaleWithdrawalMapper;
import com.hhkj.admin.sale.model.dopo.SaleWithdrawalDo;
import com.hhkj.admin.sale.model.dopo.SaleWithdrawalPo;
import com.hhkj.admin.sale.service.base.SaleWithdrawalService;
import com.ruoyi.common.base.biz.service.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author admin
 */
@Service
public class SaleWithdrawalServiceImpl
        extends BaseServiceImpl<SaleWithdrawal, SaleWithdrawalDo, SaleWithdrawalPo, SaleWithdrawalMapper>
        implements SaleWithdrawalService {

    @Override
    public BigDecimal countAccumulatePriceBySaleId(Long saleId) {
        BigDecimal accumulatePrice = this.getBaseMapper().countAccumulatePriceBySaleId(saleId);
        return accumulatePrice == null ? BigDecimal.ZERO : accumulatePrice;
    }

    @Override
    public Integer countAmountByDo(SaleWithdrawalDo conditionDo) {
        Integer amount = this.getBaseMapper().countAmountByDo(conditionDo);
        return amount == null ? 0 : amount;
    }
}




